package chapter04;
import java.util.Scanner;
public class Test01_expcetion {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入第一个数：");
        int a = scanner.nextInt();
        System.out.println("输入第二个数：");
        int b = scanner.nextInt();
        try {
            int c = a/b;
            System.out.println("计算结果为："+c);
//            System.exit(0);//关闭java虚拟机
        }catch (Exception e){
            System.out.println(e.getMessage());
        }finally {//无论如何都会被执行 除非jvm被关闭
            System.out.println("finally语句块");
        }
        System.out.println("程序结束");
    }
}
